package org.xzx.shop_api.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.xzx.shop_api.entity.Address;
import org.xzx.shop_api.entity.District;
import org.xzx.shop_api.entity.Members;
import org.xzx.shop_api.mapper.MemberMapper;
import org.xzx.shop_api.service.MembersService;
import org.xzx.shop_api.utils.JsonResult;

@Service
public class MembersServiceImpl implements MembersService {
    @Autowired
    private MemberMapper memberMapper;
    @Override
    public int insertMember(Members members) {
        return memberMapper.insertMembers(members);
    }
    @Override
    public Members getMembersByUsername(String username) {
        return memberMapper.getMembersByUsername(username);
    }

    @Override
    public int updateMember(String username, String password) {
        return memberMapper.updatePassword(username, password);
    }

    @Override
    public int updatePayPassword(int id, String payPassword) {
        return memberMapper.updatePayPassword(id, payPassword);
    }

    @Override
    public int updateMobile(int id, String mobile) {
        return memberMapper.updateMobile(id, mobile);
    }

    @Override
    public Members getMembersByMobile(String mobile) {
        return memberMapper.getMembersByMobile(mobile);
    }

    @Override
    public Members getMembersById(int id){
        return memberMapper.getMembersById(id);
    }

    @Override
    public int updateMyInfo(int id, String username, String nickname, int gender, String birthday) {
        return memberMapper.updateMyInfo(id,username,nickname,gender,birthday);
    }

    @Override
    public int updateLogo(int id, String logo) {
        return memberMapper.updateLogo(id, logo);
    }

    @Override
    public int updateIsAuth(int id, int isAuth) {
        return memberMapper.updateIsAuth(id, isAuth);
    }

    @Override
    public int insertAddress(Address address) {
        return memberMapper.insertAddress(address);
    }

    @Override
    public Members getMembersAddressListByMembersId(int member_id) {
        return memberMapper.getMembersAddressListByMembersId(member_id);
    }

    @Override
    public District getDistrictById(int pid) {
        return memberMapper.getDistrictById(pid);
    }

    @Override
    public int getDeleteById(int id) {
        return memberMapper.getDeleteById(id);
    }

    @Override
    public Address selectAddressById(int id) {
        return memberMapper.selectAddressById(id);
    }
}

















